package com.my.mybasefragment.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.my.mybasefragment.MainActivity;
import com.my.mybasefragment.R;

public class SplishActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splish);

        findViewById(R.id.btn_vp).setOnClickListener(this);
        findViewById(R.id.btn_tra).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_vp:
                goIntent(MainActivity.class);
                break;
            case R.id.btn_tra:
                goIntent(TransactionActivity.class);
                break;
        }
    }


    private void goIntent(Class cla) {
        Intent intent = new Intent(this, cla);
        startActivity(intent);
    }
}
